<template>
  <div class="tab-bar">
    <div class="tab-bar">
      <ul>
        <li is="router-link" tag="li" v-for="route in navs" :key="route.path" :to="route.path">
          <i class="iconfont" v-html="route.meta.icon"></i>
          <span>{{route.meta.title}}</span>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import routes from '@/router/routes'
export default {
  name: 'TabBar',
  computed: {
    navs () {
      console.log(routes.filter(route => route.meta && route.meta.inTabbar))
      return routes.filter(route => route.meta && route.meta.inTabbar)
    }
  }
}
</script>

<style lang="scss" scoped>
.iconfont{
  font-family:"iconfont" !important;
  font-size:16px;font-style:normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke-width: 0.2px;
  -moz-osx-font-smoothing: grayscale;}

@font-face {
font-family: 'iconfont';  /* Project id 2751343 */
src: url('http://at.alicdn.com/t/font_2751343_7e5otcj3oel.woff2?t=1629200106623') format('woff2'),
      url('http://at.alicdn.com/t/font_2751343_7e5otcj3oel.woff?t=1629200106623') format('woff'),
      url('http://at.alicdn.com/t/font_2751343_7e5otcj3oel.ttf?t=1629200106623') format('truetype');
}
.test{
  width: 375px;
  font-size: 24px;
}
.tab-bar{
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 60 px;
  background: linear-gradient(
90deg, #dd9b4c, #ffd787);
  ul{
    height: 60px;
    width: 100%;
    display: flex;
    align-items: center;
    li{
      margin-top: 5px;
      height: 60px;
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      align-items: center;
      .iconfont{
        font-size: 24px;
      }
    }
  }
}
.router-link-exact-active,.router-link-active{
  color: #f2f2ff;
}
</style>